'use strict';

function checkRegisterForm() {
    //先获取节点
    let username = document.querySelector('[name=username]').value.trim();
    let password = document.querySelector('[name=password]').value.trim();
    let password2 = document.querySelector('#password-2').value.trim();
    //再写条件
    let checkUsername = /\w{3,10}/.test(username);
    let checkPassword = password.length >= 6 && password.length <= 30;
    let checkPassword2 = password == password2;

    if (checkUsername && checkPassword && checkPassword2) {
        alert("测试成功");

    }
    else {
        alert("测试失败");
    }




// let checkUsername=/\w{3,10}/.test(username);
// let checkPassword=password.length>=6&&password.length<=30;
// let checkPassword2=password==password2;
// if(checkUsername&&checkPassword&&checkPassword2){
//     alert('测试成功');
// }
// else{
//     alert('测试失败')
// }
}